﻿using Dndz.Industries.Settings;
using Orchard;

namespace Dndz.Industries.Services
{
    internal static class CaptchaServiceConstants
    {
        internal const string CAPTCHA_DEFAULT_TEXTBOX_NAME = "captchaattempt";
        internal const string CAPTCHA_DEFAULT_GUID_FIELD_NAME = "captchaguid";
        internal const string CAPTCHA_DEFAULT_CONTENTITEM_FIELD_NAME = "captchacontentitem";
        internal const string SESSION_KEY_PREFIX = "__Captcha";
    }

    public interface ICaptchaService : IDependency
    {
        string GenerateCaptcha(string contentType, string challengeGuid, CaptchaTypePartSettings settings);
        bool IsCaptchaValid(
            string contentTypeFieldName = CaptchaServiceConstants.CAPTCHA_DEFAULT_CONTENTITEM_FIELD_NAME,
            string guidFieldName = CaptchaServiceConstants.CAPTCHA_DEFAULT_GUID_FIELD_NAME,
            string textBoxFieldName = CaptchaServiceConstants.CAPTCHA_DEFAULT_TEXTBOX_NAME);

        CaptchaTypePartSettings LoadSettings(string contentType);
    }
}
